package edu.hawaii.duedates.library;

import org.junit.Ignore;
import org.junit.Test;

import com.meterware.httpunit.WebConversation;

/**
 * Checks if login returns WebConversation and getInfo returns a string.
 * 
 * @author John Zhou
 * @author John Ly
 * 
 */
@Ignore
public class TestUhManoa extends junit.framework.TestCase {
  private final String id = System.getProperty("uhm.id");
  private final String lastName = System.getProperty("uhm.lastname");
  /**
   * Test normal operations: login.
   * 
   * @exception Exception If errors occur during login.
   */
  @Test
  public void testNormalOperation() throws Exception {
    // TO DO when testing object is figured out
    UhManoa uhLibrary = new UhManoa();
    WebConversation conversation = new WebConversation();
    assertEquals("Testing login", conversation, uhLibrary.login(this.id, this.lastName));
  }

  /**
   * Test login to invoke illegal exception.
   * 
   * @throws Exception If there was a login error.
   */
  @Test(expected = Exception.class)
  public void testIllegalLogin() throws Exception {
    UhManoa uhLibrary = new UhManoa();
    try {
      uhLibrary.login("", "");
      fail("Login did not generate exception.");
    }
    catch (Exception e) {
      assert true : e;
    }
  }
}
